package com.example.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 销售报表的VO对象
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SaleStateMentInfoVo {

    //商品ID
    private String gid;
    //购买数量
    private Integer number;
    //商品名字
    private String name;
    //商品单价
    private BigDecimal productPrice;
    //商品售价
    private BigDecimal salePrice;
    //订单总价
    private BigDecimal totalPrice;
    // 该订单id产生的利润
    private BigDecimal profitPrice;


/*
 select o.oid,
       o.ono                            as "订单编号",
       o.create_time                    as "订单时间",
       od.gid                           as "商品ID",
       od.number                        as "购买数量",
       rd.price                         as "商品单价",
       g.price                          as "商品售价",
       o.price                          as "订单总价",
       (g.price - rd.price) * od.number as "利润"
from `order` o
         inner join order_details od on o.oid = od.oid
         inner join receipts_details rd on od.gid = rd.gid
         inner join goods g on od.gid = g.gid
where od.oid = '131' and o.status='2'

    */
}
